package com.yeung.exam;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class 两数相加为0 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        if (line==null||line.equals("")) {
            System.out.println(0);
            return;
        }
        String[] split = line.split(", ");
        ArrayList<Integer> inputs = new ArrayList<>();
        for (String s : split) {
            inputs.add(Integer.parseInt(s));
        }
        //kaishi 计算
        //找到正负分割处的元素
        Collections.sort(inputs);
        int blanceIndex = 0;
        int pairs = 0;
        if (inputs.contains(0)) blanceIndex = inputs.indexOf(0);
        else {
            for (int i = 0; i < inputs.size(); i++) {
                if (inputs.get(i) > 0) {
                    blanceIndex = i;
                    break;
                }
            }
        }
        //如果第1个大于o的数下表是0及以后的,那么不存在负数,不能有结果
        if (blanceIndex == 0) {
            System.out.println(pairs);
            return;
        } else {
            for (int i = 0; i < blanceIndex; i++) {
                for (int k = blanceIndex; k < inputs.size(); k++) {
                    if (inputs.get(i) + inputs.get(k) == 0) pairs++;
                }
            }
            System.out.println(pairs);
        }

    }
}
